<template>
	<view class="app-container">
		<u-navbar :title="title" :autoBack="true" leftIconColor="#fff" placeholder bgColor="#cf141a"
			:titleStyle="{color: '#fff'}">
		</u-navbar>
		<view class="container">
			<u-parse :content="content"></u-parse>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				content: ''
			}
		},
		onLoad(option) {
			this.title = option.title
			if (option.key === 'apiUserContactus') {
				this.apiUserContactus()
			} else if (option.key === 'apiUserAboutus') {
				this.apiUserAboutus()
			} else if (option.key === 'apiUserPrivacy') {
				this.apiUserPrivacy()
			} else if (option.key === 'apiUserAgreement') {
				this.apiUserAgreement()
			}
		},
		methods: {
			apiUserContactus() {
				this.$api.apiUserContactus().then(res => {
					this.content = res.info.content
				})
			},
			apiUserAboutus() {
				this.$api.apiUserAboutus().then(res => {
					this.content = res.info.content
				})
			},
			apiUserPrivacy() {
				this.$api.apiUserPrivacy().then(res => {
					this.content = res.info.content
				})
			},
			apiUserAgreement() {
				this.$api.apiUserAgreement().then(res => {
					this.content = res.info.content
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 30rpx;
	}
</style>
